﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using NetROS.Tiers.Entities;
using NetROS.Tiers.Data;

#endregion

namespace NetROS.Tiers.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="KontoProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class KontoProviderBaseCore : EntityProviderBase<NetROS.Tiers.Entities.Konto, NetROS.Tiers.Entities.KontoKey>
	{		
		#region Get from Many To Many Relationship Functions
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, NetROS.Tiers.Entities.KontoKey key)
		{
			return Delete(transactionManager, key.ID);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="iD">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 iD)
		{
			return Delete(null, iD);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 iD);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_tblKonto_tblTipKonta key.
		///		FK_tblKonto_tblTipKonta Description: 
		/// </summary>
		/// <param name="iDTip"></param>
		/// <returns>Returns a typed collection of NetROS.Tiers.Entities.Konto objects.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTip(System.Int32 iDTip)
		{
			int count = -1;
			return GetByIDTip(iDTip, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_tblKonto_tblTipKonta key.
		///		FK_tblKonto_tblTipKonta Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <returns>Returns a typed collection of NetROS.Tiers.Entities.Konto objects.</returns>
		/// <remarks></remarks>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTip(TransactionManager transactionManager, System.Int32 iDTip)
		{
			int count = -1;
			return GetByIDTip(transactionManager, iDTip, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_tblKonto_tblTipKonta key.
		///		FK_tblKonto_tblTipKonta Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of NetROS.Tiers.Entities.Konto objects.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTip(TransactionManager transactionManager, System.Int32 iDTip, int start, int pageLength)
		{
			int count = -1;
			return GetByIDTip(transactionManager, iDTip, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_tblKonto_tblTipKonta key.
		///		fK_tblKonto_tblTipKonta Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="iDTip"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of NetROS.Tiers.Entities.Konto objects.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTip(System.Int32 iDTip, int start, int pageLength)
		{
			int count =  -1;
			return GetByIDTip(null, iDTip, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_tblKonto_tblTipKonta key.
		///		fK_tblKonto_tblTipKonta Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="iDTip"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of NetROS.Tiers.Entities.Konto objects.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTip(System.Int32 iDTip, int start, int pageLength,out int count)
		{
			return GetByIDTip(null, iDTip, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_tblKonto_tblTipKonta key.
		///		FK_tblKonto_tblTipKonta Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of NetROS.Tiers.Entities.Konto objects.</returns>
		public abstract NetROS.Tiers.Entities.TList<Konto> GetByIDTip(TransactionManager transactionManager, System.Int32 iDTip, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override NetROS.Tiers.Entities.Konto Get(TransactionManager transactionManager, NetROS.Tiers.Entities.KontoKey key, int start, int pageLength)
		{
			return GetByID(transactionManager, key.ID, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key _dta_index_tblKonto_14_2125107207__K1_K2_3 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDSifra(System.Int32 iD, System.String sifra)
		{
			int count = -1;
			return GetByIDSifra(null,iD, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K2_3 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDSifra(System.Int32 iD, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetByIDSifra(null, iD, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K2_3 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDSifra(TransactionManager transactionManager, System.Int32 iD, System.String sifra)
		{
			int count = -1;
			return GetByIDSifra(transactionManager, iD, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K2_3 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDSifra(TransactionManager transactionManager, System.Int32 iD, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetByIDSifra(transactionManager, iD, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K2_3 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDSifra(System.Int32 iD, System.String sifra, int start, int pageLength, out int count)
		{
			return GetByIDSifra(null, iD, sifra, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K2_3 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public abstract NetROS.Tiers.Entities.TList<Konto> GetByIDSifra(TransactionManager transactionManager, System.Int32 iD, System.String sifra, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key _dta_index_tblKonto_14_2125107207__K1_K5 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTip(System.Int32 iD, System.Int32 iDTip)
		{
			int count = -1;
			return GetByIDIDTip(null,iD, iDTip, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K5 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTip(System.Int32 iD, System.Int32 iDTip, int start, int pageLength)
		{
			int count = -1;
			return GetByIDIDTip(null, iD, iDTip, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K5 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTip(TransactionManager transactionManager, System.Int32 iD, System.Int32 iDTip)
		{
			int count = -1;
			return GetByIDIDTip(transactionManager, iD, iDTip, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K5 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTip(TransactionManager transactionManager, System.Int32 iD, System.Int32 iDTip, int start, int pageLength)
		{
			int count = -1;
			return GetByIDIDTip(transactionManager, iD, iDTip, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K5 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTip(System.Int32 iD, System.Int32 iDTip, int start, int pageLength, out int count)
		{
			return GetByIDIDTip(null, iD, iDTip, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K1_K5 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public abstract NetROS.Tiers.Entities.TList<Konto> GetByIDIDTip(TransactionManager transactionManager, System.Int32 iD, System.Int32 iDTip, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key _dta_index_tblKonto_14_2125107207__K4_K1_K2_5 index.
		/// </summary>
		/// <param name="analiticki"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByAnalitickiIDSifra(System.Boolean analiticki, System.Int32 iD, System.String sifra)
		{
			int count = -1;
			return GetByAnalitickiIDSifra(null,analiticki, iD, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K4_K1_K2_5 index.
		/// </summary>
		/// <param name="analiticki"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByAnalitickiIDSifra(System.Boolean analiticki, System.Int32 iD, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetByAnalitickiIDSifra(null, analiticki, iD, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K4_K1_K2_5 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="analiticki"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByAnalitickiIDSifra(TransactionManager transactionManager, System.Boolean analiticki, System.Int32 iD, System.String sifra)
		{
			int count = -1;
			return GetByAnalitickiIDSifra(transactionManager, analiticki, iD, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K4_K1_K2_5 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="analiticki"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByAnalitickiIDSifra(TransactionManager transactionManager, System.Boolean analiticki, System.Int32 iD, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetByAnalitickiIDSifra(transactionManager, analiticki, iD, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K4_K1_K2_5 index.
		/// </summary>
		/// <param name="analiticki"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByAnalitickiIDSifra(System.Boolean analiticki, System.Int32 iD, System.String sifra, int start, int pageLength, out int count)
		{
			return GetByAnalitickiIDSifra(null, analiticki, iD, sifra, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K4_K1_K2_5 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="analiticki"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public abstract NetROS.Tiers.Entities.TList<Konto> GetByAnalitickiIDSifra(TransactionManager transactionManager, System.Boolean analiticki, System.Int32 iD, System.String sifra, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key _dta_index_tblKonto_14_2125107207__K5_K1 index.
		/// </summary>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipID(System.Int32 iDTip, System.Int32 iD)
		{
			int count = -1;
			return GetByIDTipID(null,iDTip, iD, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K5_K1 index.
		/// </summary>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipID(System.Int32 iDTip, System.Int32 iD, int start, int pageLength)
		{
			int count = -1;
			return GetByIDTipID(null, iDTip, iD, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K5_K1 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipID(TransactionManager transactionManager, System.Int32 iDTip, System.Int32 iD)
		{
			int count = -1;
			return GetByIDTipID(transactionManager, iDTip, iD, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K5_K1 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipID(TransactionManager transactionManager, System.Int32 iDTip, System.Int32 iD, int start, int pageLength)
		{
			int count = -1;
			return GetByIDTipID(transactionManager, iDTip, iD, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K5_K1 index.
		/// </summary>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipID(System.Int32 iDTip, System.Int32 iD, int start, int pageLength, out int count)
		{
			return GetByIDTipID(null, iDTip, iD, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_14_2125107207__K5_K1 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public abstract NetROS.Tiers.Entities.TList<Konto> GetByIDTipID(TransactionManager transactionManager, System.Int32 iDTip, System.Int32 iD, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key _dta_index_tblKonto_7_2125107207__K1_K5_K2 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="sifra"></param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTipSifra(System.Int32 iD, System.Int32 iDTip, System.String sifra)
		{
			int count = -1;
			return GetByIDIDTipSifra(null,iD, iDTip, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K1_K5_K2 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTipSifra(System.Int32 iD, System.Int32 iDTip, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetByIDIDTipSifra(null, iD, iDTip, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K1_K5_K2 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="sifra"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTipSifra(TransactionManager transactionManager, System.Int32 iD, System.Int32 iDTip, System.String sifra)
		{
			int count = -1;
			return GetByIDIDTipSifra(transactionManager, iD, iDTip, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K1_K5_K2 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTipSifra(TransactionManager transactionManager, System.Int32 iD, System.Int32 iDTip, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetByIDIDTipSifra(transactionManager, iD, iDTip, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K1_K5_K2 index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDIDTipSifra(System.Int32 iD, System.Int32 iDTip, System.String sifra, int start, int pageLength, out int count)
		{
			return GetByIDIDTipSifra(null, iD, iDTip, sifra, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K1_K5_K2 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="iDTip"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public abstract NetROS.Tiers.Entities.TList<Konto> GetByIDIDTipSifra(TransactionManager transactionManager, System.Int32 iD, System.Int32 iDTip, System.String sifra, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key _dta_index_tblKonto_7_2125107207__K5_K1_K2 index.
		/// </summary>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipIDSifra(System.Int32 iDTip, System.Int32 iD, System.String sifra)
		{
			int count = -1;
			return GetByIDTipIDSifra(null,iDTip, iD, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K5_K1_K2 index.
		/// </summary>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipIDSifra(System.Int32 iDTip, System.Int32 iD, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetByIDTipIDSifra(null, iDTip, iD, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K5_K1_K2 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipIDSifra(TransactionManager transactionManager, System.Int32 iDTip, System.Int32 iD, System.String sifra)
		{
			int count = -1;
			return GetByIDTipIDSifra(transactionManager, iDTip, iD, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K5_K1_K2 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipIDSifra(TransactionManager transactionManager, System.Int32 iDTip, System.Int32 iD, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetByIDTipIDSifra(transactionManager, iDTip, iD, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K5_K1_K2 index.
		/// </summary>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetByIDTipIDSifra(System.Int32 iDTip, System.Int32 iD, System.String sifra, int start, int pageLength, out int count)
		{
			return GetByIDTipIDSifra(null, iDTip, iD, sifra, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the _dta_index_tblKonto_7_2125107207__K5_K1_K2 index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iDTip"></param>
		/// <param name="iD"></param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public abstract NetROS.Tiers.Entities.TList<Konto> GetByIDTipIDSifra(TransactionManager transactionManager, System.Int32 iDTip, System.Int32 iD, System.String sifra, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key IX_SifraKonto index.
		/// </summary>
		/// <param name="sifra"></param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetBySifra(System.String sifra)
		{
			int count = -1;
			return GetBySifra(null,sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the IX_SifraKonto index.
		/// </summary>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetBySifra(System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetBySifra(null, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the IX_SifraKonto index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="sifra"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetBySifra(TransactionManager transactionManager, System.String sifra)
		{
			int count = -1;
			return GetBySifra(transactionManager, sifra, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the IX_SifraKonto index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetBySifra(TransactionManager transactionManager, System.String sifra, int start, int pageLength)
		{
			int count = -1;
			return GetBySifra(transactionManager, sifra, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the IX_SifraKonto index.
		/// </summary>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public NetROS.Tiers.Entities.TList<Konto> GetBySifra(System.String sifra, int start, int pageLength, out int count)
		{
			return GetBySifra(null, sifra, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the IX_SifraKonto index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="sifra"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/> class.</returns>
		public abstract NetROS.Tiers.Entities.TList<Konto> GetBySifra(TransactionManager transactionManager, System.String sifra, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_tblKonto index.
		/// </summary>
		/// <param name="iD"></param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.Konto"/> class.</returns>
		public NetROS.Tiers.Entities.Konto GetByID(System.Int32 iD)
		{
			int count = -1;
			return GetByID(null,iD, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_tblKonto index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.Konto"/> class.</returns>
		public NetROS.Tiers.Entities.Konto GetByID(System.Int32 iD, int start, int pageLength)
		{
			int count = -1;
			return GetByID(null, iD, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_tblKonto index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.Konto"/> class.</returns>
		public NetROS.Tiers.Entities.Konto GetByID(TransactionManager transactionManager, System.Int32 iD)
		{
			int count = -1;
			return GetByID(transactionManager, iD, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_tblKonto index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.Konto"/> class.</returns>
		public NetROS.Tiers.Entities.Konto GetByID(TransactionManager transactionManager, System.Int32 iD, int start, int pageLength)
		{
			int count = -1;
			return GetByID(transactionManager, iD, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_tblKonto index.
		/// </summary>
		/// <param name="iD"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.Konto"/> class.</returns>
		public NetROS.Tiers.Entities.Konto GetByID(System.Int32 iD, int start, int pageLength, out int count)
		{
			return GetByID(null, iD, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_tblKonto index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="iD"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="NetROS.Tiers.Entities.Konto"/> class.</returns>
		public abstract NetROS.Tiers.Entities.Konto GetByID(TransactionManager transactionManager, System.Int32 iD, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#region _tblKonto_Get_KontoList_Za_Datum 
		
		/// <summary>
		///	This method wrap the '_tblKonto_Get_KontoList_Za_Datum' stored procedure. 
		/// </summary>
		/// <param name="Datum"> A <c>System.DateTime?</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="IDataReader"/> instance.</returns>
		public IDataReader Get_KontoList_Za_Datum(System.DateTime? @Datum)
		{
			return Get_KontoList_Za_Datum(null, 0, int.MaxValue , @Datum);
		}
		
		/// <summary>
		///	This method wrap the '_tblKonto_Get_KontoList_Za_Datum' stored procedure. 
		/// </summary>
		/// <param name="Datum"> A <c>System.DateTime?</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="IDataReader"/> instance.</returns>
		public IDataReader Get_KontoList_Za_Datum(int start, int pageLength, System.DateTime? @Datum)
		{
			return Get_KontoList_Za_Datum(null, start, pageLength , @Datum);
		}
				
		/// <summary>
		///	This method wrap the '_tblKonto_Get_KontoList_Za_Datum' stored procedure. 
		/// </summary>
		/// <param name="Datum"> A <c>System.DateTime?</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="IDataReader"/> instance.</returns>
		public IDataReader Get_KontoList_Za_Datum(TransactionManager transactionManager, System.DateTime? @Datum)
		{
			return Get_KontoList_Za_Datum(transactionManager, 0, int.MaxValue , @Datum);
		}
		
		/// <summary>
		///	This method wrap the '_tblKonto_Get_KontoList_Za_Datum' stored procedure. 
		/// </summary>
		/// <param name="Datum"> A <c>System.DateTime?</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="IDataReader"/> instance.</returns>
		public abstract IDataReader Get_KontoList_Za_Datum(TransactionManager transactionManager, int start, int pageLength , System.DateTime? @Datum);
		
		#endregion
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a NetROS.Tiers.Entities.TList&lt;Konto&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="NetROS.Tiers.Entities.TList&lt;Konto&gt;"/></returns>
		public static NetROS.Tiers.Entities.TList<Konto> Fill(IDataReader reader, NetROS.Tiers.Entities.TList<Konto> rows, int start, int pageLength)
		{
		// advance to the starting row
		for (int i = 0; i < start; i++)
		{
			if (!reader.Read())
			return rows; // not enough rows, just return
		}
		for (int i = 0; i < pageLength; i++)
		{
			if (!reader.Read())
			break; // we are done
			string key = null;
			
			NetROS.Tiers.Entities.Konto c = null;
			if (DataRepository.Provider.UseEntityFactory)
			{
			key = new System.Text.StringBuilder("Konto")
			.Append("|").Append((reader.IsDBNull(((int)NetROS.Tiers.Entities.KontoColumn.ID - 1))?(int)0:(System.Int32)reader[((int)NetROS.Tiers.Entities.KontoColumn.ID - 1)]).ToString()).ToString();
			c = EntityManager.LocateOrCreate<Konto>(
			key.ToString(), // EntityTrackingKey
			"Konto",  //Creational Type
			DataRepository.Provider.EntityCreationalFactoryType,  //Factory used to create entity
			DataRepository.Provider.EnableEntityTracking); // Track this entity?
			}
			else
			{
			c = new NetROS.Tiers.Entities.Konto();
			}
			
			if (!DataRepository.Provider.EnableEntityTracking ||
			c.EntityState == EntityState.Added ||
			(DataRepository.Provider.EnableEntityTracking &&
			((DataRepository.Provider.CurrentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
			(DataRepository.Provider.CurrentLoadPolicy == LoadPolicy.DiscardChanges && (c.EntityState == EntityState.Unchanged ||
								c.EntityState == EntityState.Changed)))))
						{
			c.SuppressEntityEvents = true;
			c.ID = (System.Int32)reader["ID"];
			c.Sifra = (System.String)reader["Sifra"];
			c.Naziv = (System.String)reader["Naziv"];
			c.Analiticki = (System.Boolean)reader["Analiticki"];
			c.IDTip = (System.Int32)reader["IDTip"];
			c.IDKontoPoreza = reader.IsDBNull(reader.GetOrdinal("IDKontoPoreza")) ? null : (System.Int32?)reader["IDKontoPoreza"];
			c.DatumOd = (System.DateTime)reader["DatumOd"];
			c.DatumDo = reader.IsDBNull(reader.GetOrdinal("DatumDo")) ? null : (System.DateTime?)reader["DatumDo"];
			c.PrijenosAnaliticki = reader.IsDBNull(reader.GetOrdinal("PrijenosAnaliticki")) ? null : (System.Boolean?)reader["PrijenosAnaliticki"];
			c.EntityTrackingKey = key;
			c.AcceptChanges();
			c.SuppressEntityEvents = false;
			}
			rows.Add(c);
		}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="NetROS.Tiers.Entities.Konto"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="NetROS.Tiers.Entities.Konto"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, NetROS.Tiers.Entities.Konto entity)
		{
			if (!reader.Read()) return;
			
			entity.ID = (System.Int32)reader["ID"];
			entity.Sifra = (System.String)reader["Sifra"];
			entity.Naziv = (System.String)reader["Naziv"];
			entity.Analiticki = (System.Boolean)reader["Analiticki"];
			entity.IDTip = (System.Int32)reader["IDTip"];
			entity.IDKontoPoreza = reader.IsDBNull(reader.GetOrdinal("IDKontoPoreza")) ? null : (System.Int32?)reader["IDKontoPoreza"];
			entity.DatumOd = (System.DateTime)reader["DatumOd"];
			entity.DatumDo = reader.IsDBNull(reader.GetOrdinal("DatumDo")) ? null : (System.DateTime?)reader["DatumDo"];
			entity.PrijenosAnaliticki = reader.IsDBNull(reader.GetOrdinal("PrijenosAnaliticki")) ? null : (System.Boolean?)reader["PrijenosAnaliticki"];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="NetROS.Tiers.Entities.Konto"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="NetROS.Tiers.Entities.Konto"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, NetROS.Tiers.Entities.Konto entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.ID = (System.Int32)dataRow["ID"];
			entity.Sifra = (System.String)dataRow["Sifra"];
			entity.Naziv = (System.String)dataRow["Naziv"];
			entity.Analiticki = (System.Boolean)dataRow["Analiticki"];
			entity.IDTip = (System.Int32)dataRow["IDTip"];
			entity.IDKontoPoreza = Convert.IsDBNull(dataRow["IDKontoPoreza"]) ? null : (System.Int32?)dataRow["IDKontoPoreza"];
			entity.DatumOd = (System.DateTime)dataRow["DatumOd"];
			entity.DatumDo = Convert.IsDBNull(dataRow["DatumDo"]) ? null : (System.DateTime?)dataRow["DatumDo"];
			entity.PrijenosAnaliticki = Convert.IsDBNull(dataRow["PrijenosAnaliticki"]) ? null : (System.Boolean?)dataRow["PrijenosAnaliticki"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="NetROS.Tiers.Entities.Konto"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">NetROS.Tiers.Entities.Konto Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		internal override void DeepLoad(TransactionManager transactionManager, NetROS.Tiers.Entities.Konto entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region IDTipSource	
			if (CanDeepLoad(entity, "TipKonta|IDTipSource", deepLoadType, innerList) 
				&& entity.IDTipSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IDTip;
				TipKonta tmpEntity = EntityManager.LocateEntity<TipKonta>(EntityLocator.ConstructKeyFromPkItems(typeof(TipKonta), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IDTipSource = tmpEntity;
				else
					entity.IDTipSource = DataRepository.TipKontaProvider.GetByID(transactionManager, entity.IDTip);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IDTipSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IDTipSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.TipKontaProvider.DeepLoad(transactionManager, entity.IDTipSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IDTipSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			// Deep load child collections  - Call GetByID methods when available
			
			#region PutniNalogStavkaOstaloCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PutniNalogStavkaOstalo>|PutniNalogStavkaOstaloCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PutniNalogStavkaOstaloCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PutniNalogStavkaOstaloCollection = DataRepository.PutniNalogStavkaOstaloProvider.GetByIDKontoOstalo(transactionManager, entity.ID);

				if (deep && entity.PutniNalogStavkaOstaloCollection.Count > 0)
				{
					deepHandles.Add("PutniNalogStavkaOstaloCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PutniNalogStavkaOstalo>) DataRepository.PutniNalogStavkaOstaloProvider.DeepLoad,
						new object[] { transactionManager, entity.PutniNalogStavkaOstaloCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region OSAGPromjenaCollectionGetByIDKontoTroska
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<OSAGPromjena>|OSAGPromjenaCollectionGetByIDKontoTroska", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'OSAGPromjenaCollectionGetByIDKontoTroska' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.OSAGPromjenaCollectionGetByIDKontoTroska = DataRepository.OSAGPromjenaProvider.GetByIDKontoTroska(transactionManager, entity.ID);

				if (deep && entity.OSAGPromjenaCollectionGetByIDKontoTroska.Count > 0)
				{
					deepHandles.Add("OSAGPromjenaCollectionGetByIDKontoTroska",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<OSAGPromjena>) DataRepository.OSAGPromjenaProvider.DeepLoad,
						new object[] { transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoTroska, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region OSAGPromjenaCollectionGetByIDKontoIspravka
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<OSAGPromjena>|OSAGPromjenaCollectionGetByIDKontoIspravka", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'OSAGPromjenaCollectionGetByIDKontoIspravka' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.OSAGPromjenaCollectionGetByIDKontoIspravka = DataRepository.OSAGPromjenaProvider.GetByIDKontoIspravka(transactionManager, entity.ID);

				if (deep && entity.OSAGPromjenaCollectionGetByIDKontoIspravka.Count > 0)
				{
					deepHandles.Add("OSAGPromjenaCollectionGetByIDKontoIspravka",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<OSAGPromjena>) DataRepository.OSAGPromjenaProvider.DeepLoad,
						new object[] { transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoIspravka, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PutniNalogStavkaDnevnicaCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PutniNalogStavkaDnevnica>|PutniNalogStavkaDnevnicaCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PutniNalogStavkaDnevnicaCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PutniNalogStavkaDnevnicaCollection = DataRepository.PutniNalogStavkaDnevnicaProvider.GetByIDKontoDnevnice(transactionManager, entity.ID);

				if (deep && entity.PutniNalogStavkaDnevnicaCollection.Count > 0)
				{
					deepHandles.Add("PutniNalogStavkaDnevnicaCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PutniNalogStavkaDnevnica>) DataRepository.PutniNalogStavkaDnevnicaProvider.DeepLoad,
						new object[] { transactionManager, entity.PutniNalogStavkaDnevnicaCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region KnjizenjeStavkaCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<KnjizenjeStavka>|KnjizenjeStavkaCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'KnjizenjeStavkaCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.KnjizenjeStavkaCollection = DataRepository.KnjizenjeStavkaProvider.GetByIDKonto(transactionManager, entity.ID);

				if (deep && entity.KnjizenjeStavkaCollection.Count > 0)
				{
					deepHandles.Add("KnjizenjeStavkaCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<KnjizenjeStavka>) DataRepository.KnjizenjeStavkaProvider.DeepLoad,
						new object[] { transactionManager, entity.KnjizenjeStavkaCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PutniNalogStavkaPrijevozCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PutniNalogStavkaPrijevoz>|PutniNalogStavkaPrijevozCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PutniNalogStavkaPrijevozCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PutniNalogStavkaPrijevozCollection = DataRepository.PutniNalogStavkaPrijevozProvider.GetByIDKontoPrijevoza(transactionManager, entity.ID);

				if (deep && entity.PutniNalogStavkaPrijevozCollection.Count > 0)
				{
					deepHandles.Add("PutniNalogStavkaPrijevozCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PutniNalogStavkaPrijevoz>) DataRepository.PutniNalogStavkaPrijevozProvider.DeepLoad,
						new object[] { transactionManager, entity.PutniNalogStavkaPrijevozCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region OSGrupaCollectionGetByIDKontoNabavka
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<OSGrupa>|OSGrupaCollectionGetByIDKontoNabavka", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'OSGrupaCollectionGetByIDKontoNabavka' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.OSGrupaCollectionGetByIDKontoNabavka = DataRepository.OSGrupaProvider.GetByIDKontoNabavka(transactionManager, entity.ID);

				if (deep && entity.OSGrupaCollectionGetByIDKontoNabavka.Count > 0)
				{
					deepHandles.Add("OSGrupaCollectionGetByIDKontoNabavka",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<OSGrupa>) DataRepository.OSGrupaProvider.DeepLoad,
						new object[] { transactionManager, entity.OSGrupaCollectionGetByIDKontoNabavka, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region OSGrupaCollectionGetByIDKontoIspravka
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<OSGrupa>|OSGrupaCollectionGetByIDKontoIspravka", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'OSGrupaCollectionGetByIDKontoIspravka' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.OSGrupaCollectionGetByIDKontoIspravka = DataRepository.OSGrupaProvider.GetByIDKontoIspravka(transactionManager, entity.ID);

				if (deep && entity.OSGrupaCollectionGetByIDKontoIspravka.Count > 0)
				{
					deepHandles.Add("OSGrupaCollectionGetByIDKontoIspravka",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<OSGrupa>) DataRepository.OSGrupaProvider.DeepLoad,
						new object[] { transactionManager, entity.OSGrupaCollectionGetByIDKontoIspravka, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region OSGrupaCollectionGetByIDKontoTroska
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<OSGrupa>|OSGrupaCollectionGetByIDKontoTroska", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'OSGrupaCollectionGetByIDKontoTroska' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.OSGrupaCollectionGetByIDKontoTroska = DataRepository.OSGrupaProvider.GetByIDKontoTroska(transactionManager, entity.ID);

				if (deep && entity.OSGrupaCollectionGetByIDKontoTroska.Count > 0)
				{
					deepHandles.Add("OSGrupaCollectionGetByIDKontoTroska",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<OSGrupa>) DataRepository.OSGrupaProvider.DeepLoad,
						new object[] { transactionManager, entity.OSGrupaCollectionGetByIDKontoTroska, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region OSAGPromjenaCollectionGetByIDKontoNabave
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<OSAGPromjena>|OSAGPromjenaCollectionGetByIDKontoNabave", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'OSAGPromjenaCollectionGetByIDKontoNabave' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.OSAGPromjenaCollectionGetByIDKontoNabave = DataRepository.OSAGPromjenaProvider.GetByIDKontoNabave(transactionManager, entity.ID);

				if (deep && entity.OSAGPromjenaCollectionGetByIDKontoNabave.Count > 0)
				{
					deepHandles.Add("OSAGPromjenaCollectionGetByIDKontoNabave",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<OSAGPromjena>) DataRepository.OSAGPromjenaProvider.DeepLoad,
						new object[] { transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoNabave, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region BlagajnaStavkaCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<BlagajnaStavka>|BlagajnaStavkaCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'BlagajnaStavkaCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.BlagajnaStavkaCollection = DataRepository.BlagajnaStavkaProvider.GetByIDKonto(transactionManager, entity.ID);

				if (deep && entity.BlagajnaStavkaCollection.Count > 0)
				{
					deepHandles.Add("BlagajnaStavkaCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<BlagajnaStavka>) DataRepository.BlagajnaStavkaProvider.DeepLoad,
						new object[] { transactionManager, entity.BlagajnaStavkaCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region BlagajnaCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<Blagajna>|BlagajnaCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'BlagajnaCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.BlagajnaCollection = DataRepository.BlagajnaProvider.GetByIDKonto(transactionManager, entity.ID);

				if (deep && entity.BlagajnaCollection.Count > 0)
				{
					deepHandles.Add("BlagajnaCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<Blagajna>) DataRepository.BlagajnaProvider.DeepLoad,
						new object[] { transactionManager, entity.BlagajnaCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region KontoKolonaCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<KontoKolona>|KontoKolonaCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'KontoKolonaCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.KontoKolonaCollection = DataRepository.KontoKolonaProvider.GetByIDKonto(transactionManager, entity.ID);

				if (deep && entity.KontoKolonaCollection.Count > 0)
				{
					deepHandles.Add("KontoKolonaCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<KontoKolona>) DataRepository.KontoKolonaProvider.DeepLoad,
						new object[] { transactionManager, entity.KontoKolonaCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the NetROS.Tiers.Entities.Konto object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">NetROS.Tiers.Entities.Konto instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">NetROS.Tiers.Entities.Konto Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		internal override bool DeepSave(TransactionManager transactionManager, NetROS.Tiers.Entities.Konto entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region IDTipSource
			if (CanDeepSave(entity, "TipKonta|IDTipSource", deepSaveType, innerList) 
				&& entity.IDTipSource != null)
			{
				DataRepository.TipKontaProvider.Save(transactionManager, entity.IDTipSource);
				entity.IDTip = entity.IDTipSource.ID;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<Delegate, object> deepHandles = new Dictionary<Delegate, object>();
	
			#region List<PutniNalogStavkaOstalo>
				if (CanDeepSave(entity.PutniNalogStavkaOstaloCollection, "List<PutniNalogStavkaOstalo>|PutniNalogStavkaOstaloCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PutniNalogStavkaOstalo child in entity.PutniNalogStavkaOstaloCollection)
					{
						if(child.IDKontoOstaloSource != null)
							child.IDKontoOstalo = child.IDKontoOstaloSource.ID;
						else
							child.IDKontoOstalo = entity.ID;

					}

					if (entity.PutniNalogStavkaOstaloCollection.Count > 0 || entity.PutniNalogStavkaOstaloCollection.DeletedItems.Count > 0)
					{
						DataRepository.PutniNalogStavkaOstaloProvider.Save(transactionManager, entity.PutniNalogStavkaOstaloCollection);
						
						deepHandles.Add(
							(DeepSaveHandle< PutniNalogStavkaOstalo >) DataRepository.PutniNalogStavkaOstaloProvider.DeepSave,
							new object[] { transactionManager, entity.PutniNalogStavkaOstaloCollection, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<OSAGPromjena>
				if (CanDeepSave(entity.OSAGPromjenaCollectionGetByIDKontoTroska, "List<OSAGPromjena>|OSAGPromjenaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(OSAGPromjena child in entity.OSAGPromjenaCollectionGetByIDKontoTroska)
					{
						if(child.IDKontoTroskaSource != null)
							child.IDKontoTroska = child.IDKontoTroskaSource.ID;
						else
							child.IDKontoTroska = entity.ID;

					}

					if (entity.OSAGPromjenaCollectionGetByIDKontoTroska.Count > 0 || entity.OSAGPromjenaCollectionGetByIDKontoTroska.DeletedItems.Count > 0)
					{
						DataRepository.OSAGPromjenaProvider.Save(transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoTroska);
						
						deepHandles.Add(
							(DeepSaveHandle< OSAGPromjena >) DataRepository.OSAGPromjenaProvider.DeepSave,
							new object[] { transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoTroska, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<OSAGPromjena>
				if (CanDeepSave(entity.OSAGPromjenaCollectionGetByIDKontoIspravka, "List<OSAGPromjena>|OSAGPromjenaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(OSAGPromjena child in entity.OSAGPromjenaCollectionGetByIDKontoIspravka)
					{
						if(child.IDKontoIspravkaSource != null)
							child.IDKontoIspravka = child.IDKontoIspravkaSource.ID;
						else
							child.IDKontoIspravka = entity.ID;

					}

					if (entity.OSAGPromjenaCollectionGetByIDKontoIspravka.Count > 0 || entity.OSAGPromjenaCollectionGetByIDKontoIspravka.DeletedItems.Count > 0)
					{
						DataRepository.OSAGPromjenaProvider.Save(transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoIspravka);
						
						deepHandles.Add(
							(DeepSaveHandle< OSAGPromjena >) DataRepository.OSAGPromjenaProvider.DeepSave,
							new object[] { transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoIspravka, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<PutniNalogStavkaDnevnica>
				if (CanDeepSave(entity.PutniNalogStavkaDnevnicaCollection, "List<PutniNalogStavkaDnevnica>|PutniNalogStavkaDnevnicaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PutniNalogStavkaDnevnica child in entity.PutniNalogStavkaDnevnicaCollection)
					{
						if(child.IDKontoDnevniceSource != null)
							child.IDKontoDnevnice = child.IDKontoDnevniceSource.ID;
						else
							child.IDKontoDnevnice = entity.ID;

					}

					if (entity.PutniNalogStavkaDnevnicaCollection.Count > 0 || entity.PutniNalogStavkaDnevnicaCollection.DeletedItems.Count > 0)
					{
						DataRepository.PutniNalogStavkaDnevnicaProvider.Save(transactionManager, entity.PutniNalogStavkaDnevnicaCollection);
						
						deepHandles.Add(
							(DeepSaveHandle< PutniNalogStavkaDnevnica >) DataRepository.PutniNalogStavkaDnevnicaProvider.DeepSave,
							new object[] { transactionManager, entity.PutniNalogStavkaDnevnicaCollection, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<KnjizenjeStavka>
				if (CanDeepSave(entity.KnjizenjeStavkaCollection, "List<KnjizenjeStavka>|KnjizenjeStavkaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(KnjizenjeStavka child in entity.KnjizenjeStavkaCollection)
					{
						if(child.IDKontoSource != null)
							child.IDKonto = child.IDKontoSource.ID;
						else
							child.IDKonto = entity.ID;

					}

					if (entity.KnjizenjeStavkaCollection.Count > 0 || entity.KnjizenjeStavkaCollection.DeletedItems.Count > 0)
					{
						DataRepository.KnjizenjeStavkaProvider.Save(transactionManager, entity.KnjizenjeStavkaCollection);
						
						deepHandles.Add(
							(DeepSaveHandle< KnjizenjeStavka >) DataRepository.KnjizenjeStavkaProvider.DeepSave,
							new object[] { transactionManager, entity.KnjizenjeStavkaCollection, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<PutniNalogStavkaPrijevoz>
				if (CanDeepSave(entity.PutniNalogStavkaPrijevozCollection, "List<PutniNalogStavkaPrijevoz>|PutniNalogStavkaPrijevozCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PutniNalogStavkaPrijevoz child in entity.PutniNalogStavkaPrijevozCollection)
					{
						if(child.IDKontoPrijevozaSource != null)
							child.IDKontoPrijevoza = child.IDKontoPrijevozaSource.ID;
						else
							child.IDKontoPrijevoza = entity.ID;

					}

					if (entity.PutniNalogStavkaPrijevozCollection.Count > 0 || entity.PutniNalogStavkaPrijevozCollection.DeletedItems.Count > 0)
					{
						DataRepository.PutniNalogStavkaPrijevozProvider.Save(transactionManager, entity.PutniNalogStavkaPrijevozCollection);
						
						deepHandles.Add(
							(DeepSaveHandle< PutniNalogStavkaPrijevoz >) DataRepository.PutniNalogStavkaPrijevozProvider.DeepSave,
							new object[] { transactionManager, entity.PutniNalogStavkaPrijevozCollection, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<OSGrupa>
				if (CanDeepSave(entity.OSGrupaCollectionGetByIDKontoNabavka, "List<OSGrupa>|OSGrupaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(OSGrupa child in entity.OSGrupaCollectionGetByIDKontoNabavka)
					{
						if(child.IDKontoNabavkaSource != null)
							child.IDKontoNabavka = child.IDKontoNabavkaSource.ID;
						else
							child.IDKontoNabavka = entity.ID;

					}

					if (entity.OSGrupaCollectionGetByIDKontoNabavka.Count > 0 || entity.OSGrupaCollectionGetByIDKontoNabavka.DeletedItems.Count > 0)
					{
						DataRepository.OSGrupaProvider.Save(transactionManager, entity.OSGrupaCollectionGetByIDKontoNabavka);
						
						deepHandles.Add(
							(DeepSaveHandle< OSGrupa >) DataRepository.OSGrupaProvider.DeepSave,
							new object[] { transactionManager, entity.OSGrupaCollectionGetByIDKontoNabavka, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<OSGrupa>
				if (CanDeepSave(entity.OSGrupaCollectionGetByIDKontoIspravka, "List<OSGrupa>|OSGrupaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(OSGrupa child in entity.OSGrupaCollectionGetByIDKontoIspravka)
					{
						if(child.IDKontoIspravkaSource != null)
							child.IDKontoIspravka = child.IDKontoIspravkaSource.ID;
						else
							child.IDKontoIspravka = entity.ID;

					}

					if (entity.OSGrupaCollectionGetByIDKontoIspravka.Count > 0 || entity.OSGrupaCollectionGetByIDKontoIspravka.DeletedItems.Count > 0)
					{
						DataRepository.OSGrupaProvider.Save(transactionManager, entity.OSGrupaCollectionGetByIDKontoIspravka);
						
						deepHandles.Add(
							(DeepSaveHandle< OSGrupa >) DataRepository.OSGrupaProvider.DeepSave,
							new object[] { transactionManager, entity.OSGrupaCollectionGetByIDKontoIspravka, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<OSGrupa>
				if (CanDeepSave(entity.OSGrupaCollectionGetByIDKontoTroska, "List<OSGrupa>|OSGrupaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(OSGrupa child in entity.OSGrupaCollectionGetByIDKontoTroska)
					{
						if(child.IDKontoTroskaSource != null)
							child.IDKontoTroska = child.IDKontoTroskaSource.ID;
						else
							child.IDKontoTroska = entity.ID;

					}

					if (entity.OSGrupaCollectionGetByIDKontoTroska.Count > 0 || entity.OSGrupaCollectionGetByIDKontoTroska.DeletedItems.Count > 0)
					{
						DataRepository.OSGrupaProvider.Save(transactionManager, entity.OSGrupaCollectionGetByIDKontoTroska);
						
						deepHandles.Add(
							(DeepSaveHandle< OSGrupa >) DataRepository.OSGrupaProvider.DeepSave,
							new object[] { transactionManager, entity.OSGrupaCollectionGetByIDKontoTroska, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<OSAGPromjena>
				if (CanDeepSave(entity.OSAGPromjenaCollectionGetByIDKontoNabave, "List<OSAGPromjena>|OSAGPromjenaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(OSAGPromjena child in entity.OSAGPromjenaCollectionGetByIDKontoNabave)
					{
						if(child.IDKontoNabaveSource != null)
							child.IDKontoNabave = child.IDKontoNabaveSource.ID;
						else
							child.IDKontoNabave = entity.ID;

					}

					if (entity.OSAGPromjenaCollectionGetByIDKontoNabave.Count > 0 || entity.OSAGPromjenaCollectionGetByIDKontoNabave.DeletedItems.Count > 0)
					{
						DataRepository.OSAGPromjenaProvider.Save(transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoNabave);
						
						deepHandles.Add(
							(DeepSaveHandle< OSAGPromjena >) DataRepository.OSAGPromjenaProvider.DeepSave,
							new object[] { transactionManager, entity.OSAGPromjenaCollectionGetByIDKontoNabave, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<BlagajnaStavka>
				if (CanDeepSave(entity.BlagajnaStavkaCollection, "List<BlagajnaStavka>|BlagajnaStavkaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(BlagajnaStavka child in entity.BlagajnaStavkaCollection)
					{
						if(child.IDKontoSource != null)
							child.IDKonto = child.IDKontoSource.ID;
						else
							child.IDKonto = entity.ID;

					}

					if (entity.BlagajnaStavkaCollection.Count > 0 || entity.BlagajnaStavkaCollection.DeletedItems.Count > 0)
					{
						DataRepository.BlagajnaStavkaProvider.Save(transactionManager, entity.BlagajnaStavkaCollection);
						
						deepHandles.Add(
							(DeepSaveHandle< BlagajnaStavka >) DataRepository.BlagajnaStavkaProvider.DeepSave,
							new object[] { transactionManager, entity.BlagajnaStavkaCollection, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<Blagajna>
				if (CanDeepSave(entity.BlagajnaCollection, "List<Blagajna>|BlagajnaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(Blagajna child in entity.BlagajnaCollection)
					{
						if(child.IDKontoSource != null)
							child.IDKonto = child.IDKontoSource.ID;
						else
							child.IDKonto = entity.ID;

					}

					if (entity.BlagajnaCollection.Count > 0 || entity.BlagajnaCollection.DeletedItems.Count > 0)
					{
						DataRepository.BlagajnaProvider.Save(transactionManager, entity.BlagajnaCollection);
						
						deepHandles.Add(
							(DeepSaveHandle< Blagajna >) DataRepository.BlagajnaProvider.DeepSave,
							new object[] { transactionManager, entity.BlagajnaCollection, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
	
			#region List<KontoKolona>
				if (CanDeepSave(entity.KontoKolonaCollection, "List<KontoKolona>|KontoKolonaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(KontoKolona child in entity.KontoKolonaCollection)
					{
						if(child.IDKontoSource != null)
							child.IDKonto = child.IDKontoSource.ID;
						else
							child.IDKonto = entity.ID;

					}

					if (entity.KontoKolonaCollection.Count > 0 || entity.KontoKolonaCollection.DeletedItems.Count > 0)
					{
						DataRepository.KontoKolonaProvider.Save(transactionManager, entity.KontoKolonaCollection);
						
						deepHandles.Add(
							(DeepSaveHandle< KontoKolona >) DataRepository.KontoKolonaProvider.DeepSave,
							new object[] { transactionManager, entity.KontoKolonaCollection, deepSaveType, childTypes, innerList }
						);
					}
				} 
			#endregion 
				
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region KontoChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>NetROS.Tiers.Entities.Konto</c>
	///</summary>
	public enum KontoChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>TipKonta</c> at IDTipSource
		///</summary>
		[ChildEntityType(typeof(TipKonta))]
		TipKonta,
	
		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for PutniNalogStavkaOstaloCollection
		///</summary>
		[ChildEntityType(typeof(TList<PutniNalogStavkaOstalo>))]
		PutniNalogStavkaOstaloCollection,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for OSAGPromjenaCollection
		///</summary>
		[ChildEntityType(typeof(TList<OSAGPromjena>))]
		OSAGPromjenaCollectionGetByIDKontoTroska,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for OSAGPromjenaCollection
		///</summary>
		[ChildEntityType(typeof(TList<OSAGPromjena>))]
		OSAGPromjenaCollectionGetByIDKontoIspravka,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for PutniNalogStavkaDnevnicaCollection
		///</summary>
		[ChildEntityType(typeof(TList<PutniNalogStavkaDnevnica>))]
		PutniNalogStavkaDnevnicaCollection,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for KnjizenjeStavkaCollection
		///</summary>
		[ChildEntityType(typeof(TList<KnjizenjeStavka>))]
		KnjizenjeStavkaCollection,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for PutniNalogStavkaPrijevozCollection
		///</summary>
		[ChildEntityType(typeof(TList<PutniNalogStavkaPrijevoz>))]
		PutniNalogStavkaPrijevozCollection,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for OSGrupaCollection
		///</summary>
		[ChildEntityType(typeof(TList<OSGrupa>))]
		OSGrupaCollectionGetByIDKontoNabavka,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for OSGrupaCollection
		///</summary>
		[ChildEntityType(typeof(TList<OSGrupa>))]
		OSGrupaCollectionGetByIDKontoIspravka,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for OSGrupaCollection
		///</summary>
		[ChildEntityType(typeof(TList<OSGrupa>))]
		OSGrupaCollectionGetByIDKontoTroska,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for OSAGPromjenaCollection
		///</summary>
		[ChildEntityType(typeof(TList<OSAGPromjena>))]
		OSAGPromjenaCollectionGetByIDKontoNabave,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for BlagajnaStavkaCollection
		///</summary>
		[ChildEntityType(typeof(TList<BlagajnaStavka>))]
		BlagajnaStavkaCollection,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for BlagajnaCollection
		///</summary>
		[ChildEntityType(typeof(TList<Blagajna>))]
		BlagajnaCollection,

		///<summary>
		/// Collection of <c>Konto</c> as OneToMany for KontoKolonaCollection
		///</summary>
		[ChildEntityType(typeof(TList<KontoKolona>))]
		KontoKolonaCollection,
	}
	
	#endregion KontoChildEntityTypes
	
	#region KontoFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;KontoColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Konto"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class KontoFilterBuilder : SqlFilterBuilder<KontoColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the KontoFilterBuilder class.
		/// </summary>
		public KontoFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the KontoFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public KontoFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the KontoFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public KontoFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion KontoFilterBuilder
	
	#region KontoParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;KontoColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Konto"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class KontoParameterBuilder : ParameterizedSqlFilterBuilder<KontoColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the KontoParameterBuilder class.
		/// </summary>
		public KontoParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the KontoParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public KontoParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the KontoParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public KontoParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion KontoParameterBuilder
} // end namespace
